forked from ErwinM/acts_as_tenant
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support has many through #1
Open
trevorrjohn
wants to merge
35
commits into
HashNotAdam:support_has_many_through
Choose a base branch
from
trevorrjohn:support_has_many_through
base: support_has_many_through
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Support has many through #1
trevorrjohn
wants to merge
35
commits into
HashNotAdam:support_has_many_through
from
trevorrjohn:support_has_many_through
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Test against Ruby 3.2 * Fix appraisal versions from upgrading themselves * No longer test against Ruby 2.6 * Remove database alias for Rails 6.0 and Ruby 3.1 due to Pysch changes
Also, allow to pass a scope to acts_as_tenant
* Move Sidekiq 6 to its own appraisal * Always test against the latest version of Sidekiq (7 currently) * Remove Sidekiq 7 appraisal since it's the default
Adds a section on having your rails console automatically set the current tenant on load/reload while in development. I know this has saved our team a lot of time by reducing some dev friction.
* Replace RequestStore dependency with CurrentAttributes * Update appraisals * Update lib/acts_as_tenant.rb * Update changelog
A new Active Record connection handler was added in Rails 6.1, however, the old one remains the default for upgraded applications and throws deprecation warnings under Rails 7
…deserialization of an ActiveJob to preserve the current tenant. (ErwinM#319)
Sidekiq best practices prefer JSON types and GlobalID::Locator.locate works with the string representation of GlobalID (which is a unique URI) Co-authored-by: Ziad Sawalha <[email protected]>
* add a tenant change hook * cleanup syntax for standardrb --------- Co-authored-by: Christopher Winslett <[email protected]>
While there is some support for "through" relationships, when finding the association, the pluralized foreign key is used but join tables use singular key names BREAKING CHANGE Given an assumption is being made that singular tenant/association names are belongs_to and plural names are has_many, acts_as_tenant will no longer attempt to create a new association if one already exists. This will allow those with non-standard associations to manually define the relationship
ActsAsTenant assumes that it needs to create an association with the tenant unless a record already exists when calling the tenant association. Unfortunately, until the parent record has been persisted, Active Record will not be able to find the association using the tenant association because the join record will not have an ID
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey I just wanted to rebase your work so that it was ready to be merged.